<template>
  <header class='app-header'>
    <div class="container">
      <!-- 网站logo -->
      <router-link to="/" class="app-logo">
        <h1>优乐购物</h1>
      </router-link>
      <!-- 主导航 -->
      <AppHeaderNav />
      <!-- 导航栏搜索 -->
      <AppHeaderSearch />
      <!-- 导航栏购物车 -->
      <AppHeaderCart />
    </div>
  </header>
</template>

<script>
import AppHeaderNav from '@/components/app-header-nav.vue'
import AppHeaderCart from '@/components/app-header-cart.vue'
import AppHeaderSearch from '@/components/app-header-search.vue'
export default {
  name: 'AppHeader',
  components: { AppHeaderNav, AppHeaderCart, AppHeaderSearch }
}
</script>

<style lang="less" scoped>
.app-header {
  background: #fff;
  .container {
    display: flex;
    align-items: center;
    position: relative;
  }
  .app-logo {
    width: 200px;
    height: 132px;
    text-indent: -999px;
    background-image: url(../assets/images/logo.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-position-y: 20px;
  }
  .navs {
    width: 820px;
    display: flex;
    justify-content: space-around;
    padding-left: 40px;
    li {
      margin-right: 40px;
      width: 38px;
      text-align: center;
      a {
        font-size: 16px;
        line-height: 32px;
        height: 32px;
        display: inline-block;
      }
      &:hover {
        a {
          color: @xtxColor;
          border-bottom: 1px solid @xtxColor;
        }
      }
    }
  }
  .search {
    width: 170px;
    height: 32px;
    position: relative;
    border-bottom: 1px solid #e7e7e7;
    line-height: 32px;
    .icon-search {
      font-size: 18px;
      margin-left: 5px;
    }
    input {
      width: 140px;
      padding-left: 5px;
      color: #666;
    }
  }
  .cart {
    width: 50px;
    .curr {
      height: 32px;
      line-height: 32px;
      text-align: center;
      position: relative;
      display: block;
      .icon-cart{
        font-size: 22px;
      }
      em {
        font-style: normal;
        position: absolute;
        right: 0;
        top: 0;
        padding: 1px 6px;
        line-height: 1;
        background: @helpColor;
        color: #fff;
        font-size: 12px;
        border-radius: 10px;
        font-family: Arial;
      }
    }
  }
}
</style>
